package com.mz.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * (UmsPermissionInfo)表实体类
 *
 * @author makejava
 * @since 2023-12-13 13:38:35
 */
@Data
@Accessors(chain = true)
@Valid
public class UmsPermissionInfo  {

    @TableId( type=IdType.ASSIGN_ID )
    private Long id;

    @NotNull(message = "权限名不能为空")
    @Length( min = 1, max = 20, message = "权限名（1~20位）")
    private String name;
    //唯一标识
    @NotNull(message = "权限code不能为空")
    @Length( min = 1, max = 20, message = "权限code（1~20位）")
    private String code;

    //0 标识菜单文件夹，1标识菜单项，2标识按钮
    @Min(value = 1, message = "权限类型错误")
    @Max(value = 3, message = "权限类型错误")
    @NotNull(message = "权限类型不能为空")
    private String type;

    private Long parentId;

    private Integer level;

    private Integer visibility;

    @TableField( exist = false )
    private List<UmsPermissionInfo> children;

    @TableLogic
    private Integer delFlag;

    private Long createBy;

    @TableField( fill = FieldFill.INSERT_UPDATE)
    private Date createTime;

    private Long updateBy;

    @TableField( fill = FieldFill.UPDATE)
    private Date updateTime;

}

